<template>
    <div class="overview">
        <div style="position: fixed;width: 100%;background: #fff;z-index: 99;">
            <bar text="历史数据"></bar>
        </div>
        <div class="overviewBox">
            <template>
                <div>
                    <!--流量趋势-->
                    <div class="trend">
                        <div style="display: flex;justify-content: space-between">
                            <div style="margin-left: 16px;">
                                <titles v-if="type==0" text="客流量数据"></titles>
                                <titles v-if="type==1" text="销售额数据"></titles>
                                <titles v-if="type==2" text="集客力数据"></titles>
                                <titles v-if="type==3" text="坪效值数据"></titles>
                            </div>
                            <div>
                                <el-date-picker
                                        @change="btnWeek(value1)"
                                        v-model="value1"
                                        type="week"
                                        format="yyyy-MM-dd"
                                        placeholder="选择周">
                                </el-date-picker>
                            </div>
                        </div>

                        <div class="charts" id="myChart">
                            <chart ref="child"></chart>
                        </div>
                    </div>
                </div>
            </template>
        </div>
    </div>
</template>

<script>
    import titles from "../../components/titleBar";
    import bar from "../../components/topBar";
    // 导入chart.vue子组件
    import chart from '../../components/historyChart'

    export default {
        props: {},
        components: {
            titles,
            bar,
            chart
        },
        data() {
            return {
                type: 0,
                activeName: 'first',
                value1: '2019-12-12',
                value2: '',
                list: '',
                code: 0,
                idx: 0,
                last: '',
                today: '',
                tableList: [],
                value: '',
                expireTimeOption: {
                    disabledDate(date) {
                        return date.getTime() <= Date.now();
                    }
                },
                hours: ['8:00', '9:00', '10:00', '11:00', '12:00', '13:00'],
                hour: 8,
                dateTime: '2019-12-25',
                options: [{
                    value: '0',
                    label: 'F1'
                },
                    {
                        value: '1',
                        label: 'F2'
                    }],
                value3: 'F1',
                value4: 'A-1',
                options2: [{
                    value: '0',
                    label: 'A-1'
                },
                    {
                        value: '1',
                        label: 'A-2'
                    }, {
                        value: '2',
                        label: 'A-3'
                    }, {
                        value: '3',
                        label: 'A-4'
                    }, {
                        value: '4',
                        label: 'A-5'
                    }
                ],
                floorNum: 2,
                dateTime2: '',
                flowList: [],
                // applyTime:null
            };
        },
        name: "historyData",
        mounted() {
            var type = this.$route.query.typeDate
            console.log(type, '33333')
            this.type = type
            console.log(this.type, '/////')
        },
    }
</script>

<style scoped lang="scss">
    /deep/ .el-select .el-input .el-select__caret {
        height: 0;
    }

    /deep/ .el-picker-panel {
        position: absolute;
        right: 36px;
    }

    /deep/ .emcs_charts {
        min-width: 380px !important;
    }

    /deep/ .el-input--mini .el-input__inner {
        width: 105px;
        font-size: 16px;
        line-height: 26px;
    }

    /deep/ #myChart {
        min-width: 300px;
        /*margin-right: 20px;*/
    }

    /*日期选择框*/
    /deep/ .el-date-editor.el-input, .el-date-editor.el-input__inner {
        width: 106px;
        height: 23px;
        font-size: 16px;
        /*margin-right: 20px;*/
        line-height: 23px;
    }

    /deep/ .el-range-editor--small.el-input__inner {
        width: 220px !important;
    }

    /deep/ .el-range-editor--medium.el-input__inner {
        width: 110px !important;
    }

    /deep/ .el-date-range-picker__content {
        width: 100%;
    }

    /deep/ .el-date-editor.el-input {
        width: 186px;
        height: 35px;
        margin-top: 0px;
        margin-right: -28px;
    }

    /deep/ .el-input--suffix .el-input__inner {
        padding-right: 0;
        padding-left: 10px;
    }

    /deep/ .el-input__inner {
        padding: 0 0;
        -webkit-appearance: none;
        height: 30px;
        font-size: 14px;
        line-height: 26px;
        color: #999999;
        border-radius: 0;
    }

    /deep/ .el-range-editor--medium .el-range__icon {
        line-height: 20px;
    }

    /deep/ .el-range-editor--medium .el-range-input {
        width: 35px;
    }

    /deep/ .el-input__prefix {
        margin-top: 1px;
    }

    /deep/ .el-input--prefix .el-input__inner {
        width: 120px;
        height: 30px;
        margin-left: 15px;
        padding-left: 25px;
        line-height: 26px;
    }

    /deep/ .el-input__icon {
        line-height: 0;
        margin-left: 15px;
        /*margin-right: 15px;*/
    }

    /deep/ .el-date-editor .el-range-separator {
        margin-top: -10px;
    }

    /deep/ .el-range-editor--small .el-range__icon {
        line-height: 20px;
    }

    p {
        text-align: left;
    }

    /deep/ .el-tabs--top .el-tabs__item.is-top:nth-child(2) {
        padding-left: 30px;
        padding-right: 0;
        font-size: 15px;
        /*color: #999999;*/
    }

    /deep/ .el-tabs__item {
        padding: 0 68px;
        font-size: 15px;
        color: #999999;
    }

    /deep/ .el-select .el-input .el-select__caret.is-reverse {
        line-height: 26px;
    }

    /deep/ .el-tabs__item.is-top:last-child {
        padding: 0;
        font-size: 15px;
        color: #999999;
    }

    /deep/ .el-tabs__item.is-top:last-child:hover {
        color: #409EFF;
    }

    /deep/ .el-tabs__item.is-top:nth-child(2):hover {
        color: #409EFF;
    }

    /deep/ .el-tabs__active-bar {
        height: 3px;
        background: #3B78FF;
    }

    /deep/ .el-tabs__nav {
        display: flex;
        width: 100%;
    }

    /*/deep/.el-input__inner{*/
    /*    width: 500px;*/
    /*}*/

    .topNva {
        flex: 1;
        text-align: center;
    }

    .overview {
        .overviewBox {
            padding-top: 20px;
        }
    }

    /*概览*/
    .overviewList {
        margin-left: 20px;
        display: flex;
        flex-warp: warp; /*CSS3样式，支持webkit，ms*/
        -ms-flex-wrap: wrap; /*IE9以及一下不支持*/
        -webkit-flex-wrap: wrap;

        .overviewListBox {
            width: 168px;
            height: 100px;
            box-shadow: 0px 1px 5px 2px rgba(0, 0, 0, 0.06);
            margin-top: 10px;
            margin-right: 9px;

            .overviewList-top {
                display: flex;
                align-items: center;
                margin: 14px 12px 0 8px;

                p {
                    font-size: 12px;
                    color: #333333;
                    flex: 1;
                }

                img {
                    width: 17px;
                    height: 16px;
                }
            }

            .overviewList-people {
                font-size: 20px;
                color: #333333;
                margin-left: 8px;
                margin-top: 13px;
                font-weight: 500;

                span {
                    font-size: 14px;
                    font-weight: 400;
                }
            }

            .Subheading {
                font-size: 12px;
                color: #BDBDBD;
                margin-left: 8px;
                margin-top: 13px;
            }
        }
    }

    /*流量趋势*/
    .trend {
        border-top: 0.5px solid #DEDEDE;
        margin-top: 30px;
        padding-top: 20px;

    }

    .tabList {
        margin: 0 12px 0 12px;
        display: flex;

        .tabList-btn {
            flex: 1;
            text-align: center;
            height: 26px;
            line-height: 26px;
            background: #E1E1E1;
            text-align: center;
            font-size: 14px;
            color: #333333;
            border: 0.5px solid #E1E1E1;
        }

        .tabList-txt {
            flex: 1;
            text-align: center;
            height: 26px;
            line-height: 26px;
            text-align: center;
            font-size: 14px;
            color: #999999;
            border: 0.5px solid #E1E1E1;
        }
    }

    /*经营报告*/
    .kpi {
        width: 100%;
        border-top: 0.5px solid #DEDEDE;
        padding-top: 26px;

        .kpiBox {
            display: flex;
            align-items: center;
            margin-top: 26px;
            margin-left: 16px;

            .other {
                width: 56px;
                height: 26px;
                border: 1px solid rgba(59, 120, 255, 1) !important;
                text-align: center;
                line-height: 26px;
                font-size: 14px;
                color: #3B78FF !important;
            }

            .datilOther {
                width: 56px;
                height: 26px;
                border: 1px solid rgba(225, 225, 225, 1);
                text-align: center;
                line-height: 26px;
                font-size: 14px;
                color: #999999;
            }
        }

        .kpiList {
            width: 340px;
            margin: 20px auto 27px auto;

            .kpiList-top {
                height: 32px;
                width: 100%;
                background: #E1E1E1;
                display: flex;
                align-items: center;

                .kpiList-txt {
                    font-size: 14px;
                    color: #666666;
                    flex: 1;
                    text-align: center;
                }
            }

            .kpiList-li {
                height: 32px;
                width: 100%;
                background: #fff;
                display: flex;
                align-items: center;
                border: 0.5px solid #E1E1E1;
                border-top: none;

                .kpiList-litxta {
                    font-size: 12px;
                    color: #666666;
                    flex: 1.5;
                    text-align: center;
                }

                .kpiList-litxt {
                    font-size: 12px;
                    color: #666666;
                    flex: 1;
                    text-align: center;
                }

                .kpiList-num {
                    font-size: 12px;
                    color: #74C364;
                    flex: 1;
                    text-align: center;
                }
            }
        }
    }

    /*KPI趋势对比*/
    .trends {
        border-top: 0.5px solid #DEDEDE;
        padding-top: 26px;
    }

    .topList {
        display: flex;
        justify-content: space-between;
        margin-top: -20px;

        .topOne {
            width: 400px;
            height: 300px;
            margin-top: 32px;

            .topLeft {
                display: flex;
                justify-content: flex-start;
                height: 48px;
                margin-top: 9px;
                margin-left: 20px;
                margin-right: 15px;

                .topPic {
                    width: 25px;
                    height: 20px;
                    line-height: 60px;

                    img {
                        width: 24px;
                        height: 20px;
                    }
                }

                .topPic2 {
                    width: 21px;
                    height: 21px;
                    border-radius: 50%;
                    background: #EEEEEE;
                    margin-top: 14px;
                    position: relative;
                }

                .topName {
                    width: 80px;
                    /*border: 1px solid #ccc;*/
                    font-size: 15px;
                    font-weight: 400;
                    color: rgba(102, 102, 102, 1);
                    line-height: 50px;
                    margin-left: 15px;
                    overflow: hidden;
                    text-overflow: ellipsis;
                    white-space: nowrap;
                    text-align: left;
                }
            }

        }

    }
</style>